package sales.gz.com.salescounter.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
import sales.gz.com.salescounter.R;

public class PayonlineActivity extends Activity {

    @Bind(R.id.tx_title)
    TextView title;
    @Bind(R.id.ly_left)
    LinearLayout lyleft;
    @Bind(R.id.money)
    TextView money;
    @Bind(R.id.product_name)
    TextView productName;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_choicepaytype);
        ButterKnife.bind(this);
        initview();
    }

    private void initview() {
        title.setText("选择支付方式");
        money.setText(getIntent().getStringExtra("money"));
        productName.setText(getIntent().getStringExtra("product_name"));
    }

    @OnClick({R.id.bankcard, R.id.online, R.id.li_weixin, R.id.ly_left})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.bankcard:
                Intent intent1 = new Intent(PayonlineActivity.this, CommitpayActivity.class);
                startActivity(intent1);
                break;
            case R.id.online:
                Intent intent2 = new Intent(PayonlineActivity.this, PassagewayActivity.class);
                startActivity(intent2);
                break;
            case R.id.li_weixin:
                Intent intent3 = new Intent(PayonlineActivity.this, CommitpayActivity.class);
                intent3.putExtra("sn",getIntent().getStringExtra("sn"));
                intent3.putExtra("money",getIntent().getStringExtra("money"));
                intent3.putExtra("product_name",getIntent().getStringExtra("product_name"));
                startActivity(intent3);
                break;
            case R.id.ly_left:
                finish();
                break;
        }
    }
}
